<html>
<body>
<script>
function log(message)
{
    var item = document.createElement("li");
    item.appendChild(document.createTextNode(message));
    document.getElementById("console").appendChild(item);
}

nick_load_count = 0

function nick_onload()
{
    log("NICK_ONLOAD called");
    ++nick_load_count;
    if (nick_load_count == 2) {
        log("SUCCESS.  Two loads.");
        testRunner.notifyDone();
    }
}

if (window.testRunner) {
    testRunner.waitUntilDone();
    testRunner.dumpAsText();
}
</script>
<p>This test verifies that an image which is prefetched, and which is also contained as a
subresource of the current document can be loaded correctly as a subresource.  See
bug 49236 in which this wasn't working.
<p>When this test succeeds, you'll see an image of Nick on a sailboat immediately below
this text.  When this test fails, you will see no images at all.
<link rel="prefetch" href="resources/nick.jpg" onload="nick_onload()" />
<img src="resources/nick.jpg" onload="nick_onload()" />
<hr>
<p><ol id="console"></ol></p>
</body></html>

